﻿<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <title>Aktualni zagovori diplom</title>
    <link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title"
        charset="utf-8" />
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js"></script>
    <script type="text/javascript" charset="utf-8" src="cordova-1.7.0.js"></script>
    <script type="text/javascript">

        function loadXMLDoc() {
            var xmlhttp = new XMLHttpRequest();
            xmlhttp.open("POST", "http://164.8.251.99:9793/services/cir2012/FeriZagovori?wsdl", false);
            xmlhttp.onreadystatechange = function () {
                if (xmlhttp.readyState == 4) {
                    var xmlString = xmlhttp.responseText;

                    var parser = new DOMParser();
                    var xmlDoc = parser.parseFromString(xmlString, "application/xml");

                    var stevilo = xmlDoc.getElementsByTagName("Zagovor");


                    for (var j = 0; j < stevilo.length; j++) {
                        var imeKandidata = xmlDoc.getElementsByTagName("ImeKandidata")[j].childNodes[0].nodeValue;
                        var NaslovDiplomskegaDela = xmlDoc.getElementsByTagName("NaslovDiplomskegaDela")[j].childNodes[0].nodeValue;
                        var DatumInMestoZagovora = xmlDoc.getElementsByTagName("DatumInMestoZagovora")[j].childNodes[0].nodeValue;

                        document.getElementById("main").innerHTML += imeKandidata + "</br>" + "Naslov: " + NaslovDiplomskegaDela + "</br>" + "Datum in lokacija zagovora: " + DatumInMestoZagovora + "</br></br>";
                    }
                }
            }

            xmlhttp.setRequestHeader("SOAPAction", "FeriZagovori");
            xmlhttp.setRequestHeader("Content-Type", "text/xml");
            var xml = '<?xml version="1.0" encoding="utf-8"?>' +
                 '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' +
                                'xmlns:xsd="http://www.w3.org/2001/XMLSchema" ' +
                                'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">' +
                   '<soap:Body> ' +
                     '<FeriZagovori xmlns="http://services.mashup.wso2.org/FeriZagovori"> ' +
                     '</FeriZagovori> ' +
                   '</soap:Body> ' +
                 '</soap:Envelope>';
            xmlhttp.send(xml);



        }

        document.addEventListener("deviceready", loadXMLDoc, false);

    </script>
</head>
<body>
    <h1>
        Aktualni zagovori diplom</h1>
    <div id="main">
    </div>
</body>
</html>
